package com.mym.demo;

/**
 * @author miao
 * @version 1.0
 * @date 2025/4/10 17:16
 * @description
 */
public class Test5 {
    public static boolean BiJiao(double num1,double num2){
        boolean flag=false;
        if (num1==num2) {
            flag=true;
        }
        return flag;
    }
    public static double Max(double num1,double num2){
        double max=0;
        if (num1>num2){
            max=num1;
        }
        return max;
    }
    public static void ArraysGr(double num1,double num2,double num3){
        double[] doubles = new double[3];
        doubles[0]=num1;
        doubles[1]=num2;
        doubles[2]=num3;
        for (int i = 0; i < doubles.length; i++) {
            System.out.println(doubles[i]);
        }
        for (int i = 1; i < doubles.length-1; i++) {
            for (int j = 0; j < doubles.length - i; j++) {
                if (doubles[j] > doubles[j + 1]) {
                    double temp = doubles[j];
                    doubles[j] = doubles[j + 1];
                    doubles[j + 1] = temp;
                }

            }
        }
        for (int i = 0; i < doubles.length; i++) {
            System.out.println(doubles[i]);
        }
    }

    public static void main(String[] args) {
        Circle circle = new Circle(2);
        Rectangle rectangle = new Rectangle(2,4);
        Triangle triangle = new Triangle(3,4,5);
        System.out.println(circle.getArea());
        System.out.println(circle.getPerimeter());
        System.out.println(circle.getInfo());
        System.out.println(rectangle.getArea());
        System.out.println(rectangle.getPerimeter());
        System.out.println(rectangle.getInfo());
        System.out.println(triangle.getArea());
        System.out.println(triangle.getPerimeter());
        System.out.println(triangle.getInfo());
        System.out.println(BiJiao(circle.getArea(), rectangle.getArea()));
        System.out.println(BiJiao(circle.getArea(), triangle.getArea()));
        System.out.println(Max(circle.getArea(), triangle.getArea()));
        ArraysGr(circle.getArea(), rectangle.getArea(), triangle.getArea());


    }

}
